{include file='index/_header.html'}

<div class="top-header" style="background-image: url(__STATIC__/themes/__THEME__/img/banner.jpg)">
    <div class="container">
        <h2 class="top-title">{$topic.title}</h2>
        <p class="lead top-description">
            {$topic.subtitle}
            <span class="pull-right"><a href="{:url('index/index')}">首页 </a>  &raquo; <a href="{$topic.nav_href}">{$topic.title}</a></span>
        </p>
    </div>
</div>

<div class="container mtn">

    <div class="row">
        <!-- content -->
        <div class="col-sm-9">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">{$topic.nav_title}</h3>
                </div>
                {php $list=db($topic['model_table'])->cache()->field('content', true)->where($page_where)->where('status=1')->order('sort ASC,id DESC')->paginate(6)}
                {empty $list->toArray():}
                <div class="panel-body">暂无记录！</div>
                {else:}
                <div class="panel-body">
                    <div class="row">
                        {foreach $list as $vo}
                        <div class="col-lg-4">
                            <div class="panel panel-default">
                                <a href="{:url('product/detail',['id'=>$vo['id']])}">
                                    <img class="card-img-top" src="{:rand_thumb($vo['thumb'],$vo['id'])}" width="100%" alt="{$vo.title}" />
                                </a>
                                <div class="panel-body">
                                    <h4 class="card-title">{$vo.title} <span class="pull-right text-danger"> {if $vo['price']>0:}￥{$vo.price}{else:}免费{/if}</span></h4>
                                    <p class="card-text">{$vo.summary|str_substr=30}</p>
                                    <div class="text-right">
                                        {!empty $vo['git_link']:}<a class="btn btn-primary btn-sm" href="{$vo.git_link}" target="_blank">仓库 &raquo;</a>{/empty}
                                        {!empty $vo['demo_link']:}<a class="btn btn-primary btn-sm" href="{$vo.demo_link}" target="_blank">演示 &raquo;</a>{/empty}
                                        {!empty $vo['down_zip']:}<a class="btn btn-primary btn-sm" href="{$vo.down_zip}">下载 &raquo;</a>{/empty}
                                    </div>
                                </div>
                            </div>
                        </div>
                        {/foreach}
                    </div>
                </div>
                <div class="panel-footer">{$list->links()}</div>
                {/empty}
            </div>
        </div>
        <!-- sidebar -->
        <div class="col-sm-3">

            {!empty $topic['sub_nav']:}
            <div class="panel panel-default">
                <div class="list-group">
                    {foreach $topic['sub_nav'] as $sub}
                    <a href="{$sub.href}" class="list-group-item{if $sub['is_active']:} active{/if}" {$sub.target}>{$sub.title}</a>
                    {/foreach}
                </div>
            </div>
            {/empty}

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">在线交流</h3>
                </div>
                <div class="panel-body">
                    QQ群：<a href="{:site('qq_qun1_link')}" target="_blank">{:site('qq_qun1')}</a>
                </div>
            </div>

        </div>
    </div>

</div>
{include file='index/_footer.html'}
</body>
</html>